cmake_minimum_required(VERSION 3.5)
project(ForceMeasure)
find_package(Eigen3)
find_package(SqliteOrm REQUIRED)

find_package (SQLite3)
find_package(spdlog 1.8.0 REQUIRED)
set(CMAKE_CXX_STANDARD 14)

find_package(catkin REQUIRED COMPONENTS
        roscpp
        rospy
        std_msgs
        hirop_msgs
        message_generation
        std_srvs
 )


INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR}
        StateController
        StateController/Semp
        StateController/SqlController
        StateController/State
        StateController/SqlController/dao
        ${spdlog_INCLUDE_DIR}
        ${catkin_INCLUDE_DIRS}
        /home/fshs/catkin_ws_pih/devel/include
        /home/fshs/catkin_ws/devel/include
        )


include_directories(${SQLITE3_INCLUDE_DIRS} ${SqliteOrm_INCLUDE_DIR})
LINK_DIRECTORIES(${SqliteOrm_LIBRARY_DIR} ${SQLITE3_LIBRARY_DIR})


#add_executable(ForceEigenTest
add_library(${PROJECT_NAME} SHARED
        StateController/State/Basic/PlaformStateAbstract.cpp
        StateController/State/Basic/PlaformStateAbstract.h
        StateController/TStateController.cpp
        StateController/TStateController.h
        StateController/State/TInitState.cpp
        StateController/State/TInitState.h
        StateController/State/Exception/PlaformTException.h
        StateController/State/Factory/StateFactory.h
        StateController/State/Exception/PlaformFactoryException.h
        StateController/State/Factory/StateFactory.cpp
        StateController/RosHandler/RosHandler.cpp
        StateController/RosHandler/RosHandler.h
        StateController/State/TPrepareState.cpp
        StateController/State/TPrepareState.h
        StateController/log/SqdLoger.h
        StateController/SqlController/SqlController.cpp
        StateController/SqlController/SqlController.h
        StateController/SqlController/dao/SqlSqliteDao.cpp
        StateController/SqlController/dao/SqlSqliteDao.h
        StateController/State/StateSelection/StateSelection.h
        StateController/State/TRunningState.cpp
        StateController/State/TRunningState.h
        StateController/State/TErrorState.cpp
        StateController/State/TErrorState.h
        StateController/State/DataBaseStruct/DataBaseStruct.h
        StateController/Semp/CSemaphore.cpp
        StateController/State/monitor/MonitorClient.cpp
        StateController/State/monitor/MonitorClient.h
        StateController/State/monitor/MonitorInterface.h
        StateController/SqlController/dao/SqlDaoInterface.h
#        StateController/SqlController/dao/MySqlDaoImpl.cpp
#        StateController/SqlController/dao/MySqlDaoImpl.h
        StateController/Global/GlobalVar.h
        StateController/State/StateSelection/StateSelection.cpp StateController/log/SqlLoger.cpp)

target_link_libraries(${PROJECT_NAME} pthread    ${SqliteOrm_LIBRARIES} sqlite3 ${SQLITE3_LIBRARIES} ${catkin_LIBRARIES})

#
#add_executable(${PROJECT_NAME}_test   ForceDemisionTest.cpp)
#target_link_libraries(${PROJECT_NAME}_test gtest ${PROJECT_NAME})
#
##
#add_executable(${PROJECT_NAME}_sql_test    UnitTest/SqlTest.cpp)
#target_link_libraries(${PROJECT_NAME}_sql_test gtest  ${PROJECT_NAME})
#
##
add_executable(${PROJECT_NAME}_TState_Test    UnitTest/TStateTest.cpp)
target_link_libraries(${PROJECT_NAME}_TState_Test  ${PROJECT_NAME})